import requset from '@/utils/requset';
//注册接口
export const registerService = ({ username, password, repassword }) => {
  return requset.post('/api/reg', { username, password, repassword })
}
//登录接口
export const loginService = ({ username, password }) => {
  return requset.post('/api/login', { username, password })
}
export const userService = () => {
  return requset.get('/my/userinfo')
}
export const userUpdateInfoService = ({ id, nickname, email }) => {
  return requset.put('/my/userinfo', { id, nickname, email })
}
export const userupdateImgservice = (avatar) => {
  return requset.patch('/my/update/avatar', { avatar })
}
export const userUpdatePass = ({ old_pwd, new_pwd, re_pwd }) => {
  return requset.patch('/my/updatepwd', { old_pwd, new_pwd, re_pwd })
}